import React, { Component } from 'react'
import Son from './Son'

export default class Father extends Component {
    state = {
        num: null
    }
    render() {
        const { num } = this.state
        return (
            <div>
                <h4>
                    我是父组件 -- { num }
                </h4>
                <Son acceptCount = {(num) => {
                    this.setState({
                        num
                    })
                    console.log('我是父组件中的函数', num)
                }}/>
            </div>
        )
    }
}
